home *** CD-ROM | disk | FTP | other *** search
- global gSize, gCast, gVariable, gFirstColor, gSecondColor, myCurrentImage, myCurrentPreview
-
- on toolGradientH
- member("state1 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- startX = (the mouseH - sprite(1).left) * 2 / gVariable / 2
- startY = (the mouseV - sprite(1).top) * 2 / gVariable / 2
- myShape = rect(0, 0, 0, 0)
- myStartImage = duplicate(member(gSize & "x" & gSize, gCast).image)
- myCurrentImage = duplicate(member(gSize & "x" & gSize, gCast).image)
- myCurrentPreview = duplicate(member("preview", gCast).image)
- repeat while the mouseDown
- myCurrentImage.copyPixels(myStartImage, myStartImage.rect, myStartImage.rect)
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) < startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) < startX) then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, (the mouseV - sprite(1).top) * 2 / gVariable / 2, startX + 1, startY + 1)
- else
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) < startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) >= startX) then
- myShape = rect(startX, (the mouseV - sprite(1).top) * 2 / gVariable / 2, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, startY + 1)
- else
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) >= startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) < startX) then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, startY, startX + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- else
- if ((the mouseV - sprite(1).top) * 2 / gVariable / 2) = startY then
- myShape = rect(startX, (the mouseV - sprite(1).top) * 2 / gVariable / 2, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, startY + 1)
- else
- if ((the mouseH - sprite(1).left) * 2 / gVariable / 2) = startX then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, startY, startX + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- else
- myShape = rect(startX, startY, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- end if
- end if
- end if
- end if
- end if
- if (myShape.width = 0) or (myShape.height = 0) then
- nothing()
- next repeat
- end if
- firstIndex = gFirstColor.paletteIndex
- secondIndex = gSecondColor.paletteIndex
- myShapeWidth = myShape.width
- colorSpread = abs(firstIndex - secondIndex) + 1
- colorStep = colorSpread / float(myShapeWidth)
- l = myShape.left
- r = l + 1
- c = firstIndex
- repeat while myShapeWidth > 1
- myCurrentImage.fill(rect(l, myShape.top, r, myShape.bottom), [#shapeType: #rect, #lineSize: 0, #color: paletteIndex(c)])
- myShapeWidth = myShapeWidth - 1
- colorSpread = secondIndex - c
- colorStep = colorSpread / float(myShapeWidth)
- l = r
- r = l + 1
- c = c + colorStep
- end repeat
- myCurrentImage.fill(rect(l, myShape.top, myShape.right, myShape.bottom), [#shapeType: #rect, #lineSize: 0, #color: paletteIndex(c)])
- member(gSize & "x" & gSize, gCast).image.copyPixels(myCurrentImage, myCurrentImage.rect, myCurrentImage.rect)
- updateStage()
- put myShape.width.abs into field "dimension status W"
- put myShape.height.abs into field "dimension status H"
- fnUpdatePreview()
- end repeat
- sprite(35).pState = 0
- sendSprite(35, #setMember)
- member("state2 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- myStartImage = VOID
- myCurrentImage = VOID
- myCurrentPreview = VOID
- put EMPTY into field "dimension status W"
- put EMPTY into field "dimension status H"
- end
-
- on toolGradientV
- member("state1 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- startX = (the mouseH - sprite(1).left) * 2 / gVariable / 2
- startY = (the mouseV - sprite(1).top) * 2 / gVariable / 2
- myShape = rect(0, 0, 0, 0)
- myStartImage = duplicate(member(gSize & "x" & gSize, gCast).image)
- myCurrentImage = duplicate(member(gSize & "x" & gSize, gCast).image)
- myCurrentPreview = duplicate(member("preview", gCast).image)
- repeat while the mouseDown
- myCurrentImage.copyPixels(myStartImage, myStartImage.rect, myStartImage.rect)
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) < startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) < startX) then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, (the mouseV - sprite(1).top) * 2 / gVariable / 2, startX + 1, startY + 1)
- else
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) < startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) >= startX) then
- myShape = rect(startX, (the mouseV - sprite(1).top) * 2 / gVariable / 2, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, startY + 1)
- else
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) >= startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) < startX) then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, startY, startX + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- else
- if ((the mouseV - sprite(1).top) * 2 / gVariable / 2) = startY then
- myShape = rect(startX, (the mouseV - sprite(1).top) * 2 / gVariable / 2, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, startY + 1)
- else
- if ((the mouseH - sprite(1).left) * 2 / gVariable / 2) = startX then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, startY, startX + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- else
- myShape = rect(startX, startY, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- end if
- end if
- end if
- end if
- end if
- if (myShape.width = 0) or (myShape.height = 0) then
- nothing()
- next repeat
- end if
- firstIndex = gFirstColor.paletteIndex
- secondIndex = gSecondColor.paletteIndex
- myShapeHeight = myShape.height
- colorSpread = abs(firstIndex - secondIndex) + 1
- colorStep = colorSpread / float(myShapeHeight)
- t = myShape.top
- b = t + 1
- c = firstIndex
- repeat while myShapeHeight > 1
- myCurrentImage.fill(rect(myShape.left, t, myShape.right, b), [#shapeType: #rect, #lineSize: 0, #color: paletteIndex(c)])
- myShapeHeight = myShapeHeight - 1
- colorSpread = secondIndex - c
- colorStep = colorSpread / float(myShapeHeight)
- t = b
- b = t + 1
- c = c + colorStep
- end repeat
- myCurrentImage.fill(rect(myShape.left, t, myShape.right, myShape.bottom), [#shapeType: #rect, #lineSize: 0, #color: paletteIndex(c)])
- member(gSize & "x" & gSize, gCast).image.copyPixels(myCurrentImage, myCurrentImage.rect, myCurrentImage.rect)
- updateStage()
- put myShape.width.abs into field "dimension status W"
- put myShape.height.abs into field "dimension status H"
- fnUpdatePreview()
- end repeat
- sprite(35).pState = 0
- sendSprite(35, #setMember)
- member("state2 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- myStartImage = VOID
- myCurrentImage = VOID
- myCurrentPreview = VOID
- put EMPTY into field "dimension status W"
- put EMPTY into field "dimension status H"
- end
-
- on toolGradientOval
- member("state1 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- startX = (the mouseH - sprite(1).left) * 2 / gVariable / 2
- startY = (the mouseV - sprite(1).top) * 2 / gVariable / 2
- myShape = rect(0, 0, 0, 0)
- myStartImage = duplicate(member(gSize & "x" & gSize, gCast).image)
- myCurrentImage = duplicate(member(gSize & "x" & gSize, gCast).image)
- myCurrentPreview = duplicate(member("preview", gCast).image)
- repeat while the mouseDown
- myCurrentImage.copyPixels(myStartImage, myStartImage.rect, myStartImage.rect)
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) < startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) < startX) then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, (the mouseV - sprite(1).top) * 2 / gVariable / 2, startX + 1, startY + 1)
- else
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) < startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) >= startX) then
- myShape = rect(startX, (the mouseV - sprite(1).top) * 2 / gVariable / 2, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, startY + 1)
- else
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) >= startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) < startX) then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, startY, startX + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- else
- if ((the mouseV - sprite(1).top) * 2 / gVariable / 2) = startY then
- myShape = rect(startX, (the mouseV - sprite(1).top) * 2 / gVariable / 2, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, startY + 1)
- else
- if ((the mouseH - sprite(1).left) * 2 / gVariable / 2) = startX then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, startY, startX + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- else
- myShape = rect(startX, startY, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- end if
- end if
- end if
- end if
- end if
- if (myShape.height < 3) or (myShape.width < 3) then
- myCurrentImage.fill(myShape, [#shapeType: #oval, #lineSize: 0, #color: gFirstColor])
- next repeat
- end if
- myShapeHeight = myShape.height
- myShapeWidth = myShape.width
- firstIndex = gFirstColor.paletteIndex
- secondIndex = gSecondColor.paletteIndex
- colorSpread = abs(firstIndex - secondIndex) + 1
- colorStep = ((colorSpread / float(myShape.height) * 2) + (colorSpread / float(myShape.width) * 2)) / 2
- l = myShape.left
- t = myShape.top
- r = myShape.right
- b = myShape.bottom
- c = firstIndex
- repeat while (myShapeHeight > 2) and (myShapeWidth > 2)
- myCurrentImage.fill(rect(l, t, r, b), [#shapeType: #oval, #lineSize: 0, #color: paletteIndex(c)])
- myShapeHeight = myShapeHeight - 2
- myShapeWidth = myShapeWidth - 2
- colorSpread = secondIndex - c
- colorStep = ((colorSpread / float(myShapeHeight) * 2) + (colorSpread / float(myShapeWidth) * 2)) / 2
- l = l + 1
- t = t + 1
- r = r - 1
- b = b - 1
- c = c + colorStep
- end repeat
- if (myShapeHeight = 1) and (myShapeWidth = 1) then
- myCurrentImage.setPixel(l, t, gSecondColor)
- else
- myCurrentImage.fill(rect(l, t, r, b), [#shapeType: #oval, #lineSize: 0, #color: gSecondColor])
- end if
- member(gSize & "x" & gSize, gCast).image.copyPixels(myCurrentImage, myCurrentImage.rect, myCurrentImage.rect)
- updateStage()
- put myShape.width.abs into field "dimension status W"
- put myShape.height.abs into field "dimension status H"
- fnUpdatePreview()
- end repeat
- sprite(35).pState = 0
- sendSprite(35, #setMember)
- member("state2 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- myStartImage = VOID
- myCurrentImage = VOID
- myCurrentPreview = VOID
- put EMPTY into field "dimension status W"
- put EMPTY into field "dimension status H"
- end
-
- on toolGradientRect
- member("state1 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- startX = (the mouseH - sprite(1).left) * 2 / gVariable / 2
- startY = (the mouseV - sprite(1).top) * 2 / gVariable / 2
- myShape = rect(0, 0, 0, 0)
- myStartImage = duplicate(member(gSize & "x" & gSize, gCast).image)
- myCurrentImage = duplicate(member(gSize & "x" & gSize, gCast).image)
- myCurrentPreview = duplicate(member("preview", gCast).image)
- repeat while the mouseDown
- myCurrentImage.copyPixels(myStartImage, myStartImage.rect, myStartImage.rect)
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) < startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) < startX) then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, (the mouseV - sprite(1).top) * 2 / gVariable / 2, startX + 1, startY + 1)
- else
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) < startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) >= startX) then
- myShape = rect(startX, (the mouseV - sprite(1).top) * 2 / gVariable / 2, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, startY + 1)
- else
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) >= startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) < startX) then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, startY, startX + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- else
- if ((the mouseV - sprite(1).top) * 2 / gVariable / 2) = startY then
- myShape = rect(startX, (the mouseV - sprite(1).top) * 2 / gVariable / 2, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, startY + 1)
- else
- if ((the mouseH - sprite(1).left) * 2 / gVariable / 2) = startX then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, startY, startX + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- else
- myShape = rect(startX, startY, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- end if
- end if
- end if
- end if
- end if
- if (myShape.height < 3) or (myShape.width < 3) then
- myCurrentImage.fill(myShape, [#shapeType: #rect, #lineSize: 0, #color: gFirstColor])
- next repeat
- end if
- myShapeHeight = myShape.height
- myShapeWidth = myShape.width
- firstIndex = gFirstColor.paletteIndex
- secondIndex = gSecondColor.paletteIndex
- colorSpread = abs(firstIndex - secondIndex) + 1
- colorStep = ((colorSpread / float(myShape.height) * 2) + (colorSpread / float(myShape.width) * 2)) / 2
- l = myShape.left
- t = myShape.top
- r = myShape.right
- b = myShape.bottom
- c = firstIndex
- repeat while (myShapeHeight > 2) and (myShapeWidth > 2)
- myCurrentImage.fill(rect(l, t, r, b), [#shapeType: #rect, #lineSize: 0, #color: paletteIndex(c)])
- myShapeHeight = myShapeHeight - 2
- myShapeWidth = myShapeWidth - 2
- colorSpread = secondIndex - c
- colorStep = ((colorSpread / float(myShapeHeight) * 2) + (colorSpread / float(myShapeWidth) * 2)) / 2
- l = l + 1
- t = t + 1
- r = r - 1
- b = b - 1
- c = c + colorStep
- end repeat
- if (myShapeHeight = 1) and (myShapeWidth = 1) then
- myCurrentImage.setPixel(l, t, gSecondColor)
- else
- myCurrentImage.fill(rect(l, t, r, b), [#shapeType: #rect, #lineSize: 0, #color: gSecondColor])
- end if
- member(gSize & "x" & gSize, gCast).image.copyPixels(myCurrentImage, myCurrentImage.rect, myCurrentImage.rect)
- updateStage()
- put myShape.width.abs into field "dimension status W"
- put myShape.height.abs into field "dimension status H"
- fnUpdatePreview()
- end repeat
- sprite(35).pState = 0
- sendSprite(35, #setMember)
- member("state2 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- myStartImage = VOID
- myCurrentImage = VOID
- myCurrentPreview = VOID
- put EMPTY into field "dimension status W"
- put EMPTY into field "dimension status H"
- end
-